{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 获取庄家还未拉升的股票"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [],
   "source": [
    "import numpy as np\n",
    "import sys\n",
    "sys.path.append(\"../utils/\")\n",
    "import compete_banker\n",
    "import date_util"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {},
   "outputs": [],
   "source": [
    "start_date = \"20191008\"\n",
    "end_date = \"20191031\"\n",
    "stock_list = []\n",
    "\n",
    "date_range = date_util.get_work_day_range(start_date, end_date)\n",
    "\n",
    "for date in date_range:\n",
    "    stock = compete_banker.get_declining_stock(date, ready=False)\n",
    "    if stock != []:\n",
    "        for sto in stock:\n",
    "            stock_list.append(sto)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "array(['000620.SZ', '000677.SZ', '002083.SZ', '002104.SZ', '002301.SZ',\n",
       "       '002332.SZ', '002416.SZ', '002447.SZ', '002515.SZ', '002563.SZ',\n",
       "       '002626.SZ', '002893.SZ', '600129.SH', '600208.SH', '600350.SH',\n",
       "       '600491.SH', '600966.SH', '601139.SH', '601567.SH', '601677.SH',\n",
       "       '603042.SH', '603081.SH', '603308.SH', '603321.SH', '603595.SH',\n",
       "       '603798.SH', '603839.SH', '603919.SH'], dtype='<U9')"
      ]
     },
     "execution_count": 4,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock_list = np.unique(np.array(stock_list))\n",
    "stock_list"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 12,
   "metadata": {},
   "outputs": [],
   "source": [
    "date = \"20191021\"\n",
    "stock = compete_banker.get_declining_stock(date, ready=False)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 13,
   "metadata": {},
   "outputs": [
    {
     "data": {
      "text/plain": [
       "['000027.SZ',\n",
       " '000031.SZ',\n",
       " '000069.SZ',\n",
       " '000090.SZ',\n",
       " '000338.SZ',\n",
       " '000402.SZ',\n",
       " '000425.SZ',\n",
       " '000429.SZ',\n",
       " '000523.SZ',\n",
       " '000544.SZ',\n",
       " '000586.SZ',\n",
       " '000589.SZ',\n",
       " '000598.SZ',\n",
       " '000632.SZ',\n",
       " '000656.SZ',\n",
       " '000657.SZ',\n",
       " '000667.SZ',\n",
       " '000718.SZ',\n",
       " '000759.SZ',\n",
       " '000785.SZ',\n",
       " '000803.SZ',\n",
       " '000863.SZ',\n",
       " '000883.SZ',\n",
       " '000895.SZ',\n",
       " '000915.SZ',\n",
       " '000931.SZ',\n",
       " '000963.SZ',\n",
       " '000993.SZ',\n",
       " '001965.SZ',\n",
       " '002025.SZ',\n",
       " '002039.SZ',\n",
       " '002042.SZ',\n",
       " '002058.SZ',\n",
       " '002064.SZ',\n",
       " '002073.SZ',\n",
       " '002078.SZ',\n",
       " '002079.SZ',\n",
       " '002080.SZ',\n",
       " '002083.SZ',\n",
       " '002105.SZ',\n",
       " '002164.SZ',\n",
       " '002177.SZ',\n",
       " '002182.SZ',\n",
       " '002202.SZ',\n",
       " '002212.SZ',\n",
       " '002242.SZ',\n",
       " '002270.SZ',\n",
       " '002275.SZ',\n",
       " '002318.SZ',\n",
       " '002326.SZ',\n",
       " '002331.SZ',\n",
       " '002335.SZ',\n",
       " '002372.SZ',\n",
       " '002392.SZ',\n",
       " '002401.SZ',\n",
       " '002428.SZ',\n",
       " '002438.SZ',\n",
       " '002455.SZ',\n",
       " '002465.SZ',\n",
       " '002478.SZ',\n",
       " '002489.SZ',\n",
       " '002550.SZ',\n",
       " '002559.SZ',\n",
       " '002589.SZ',\n",
       " '002591.SZ',\n",
       " '002595.SZ',\n",
       " '002641.SZ',\n",
       " '002683.SZ',\n",
       " '002724.SZ',\n",
       " '002725.SZ',\n",
       " '002728.SZ',\n",
       " '002746.SZ',\n",
       " '002763.SZ',\n",
       " '002781.SZ',\n",
       " '002799.SZ',\n",
       " '002830.SZ',\n",
       " '002857.SZ',\n",
       " '600021.SH',\n",
       " '600026.SH',\n",
       " '600028.SH',\n",
       " '600033.SH',\n",
       " '600035.SH',\n",
       " '600038.SH',\n",
       " '600059.SH',\n",
       " '600070.SH',\n",
       " '600098.SH',\n",
       " '600153.SH',\n",
       " '600170.SH',\n",
       " '600177.SH',\n",
       " '600185.SH',\n",
       " '600188.SH',\n",
       " '600216.SH',\n",
       " '600236.SH',\n",
       " '600285.SH',\n",
       " '600298.SH',\n",
       " '600317.SH',\n",
       " '600333.SH',\n",
       " '600350.SH',\n",
       " '600360.SH',\n",
       " '600376.SH',\n",
       " '600377.SH',\n",
       " '600389.SH',\n",
       " '600429.SH',\n",
       " '600449.SH',\n",
       " '600461.SH',\n",
       " '600466.SH',\n",
       " '600469.SH',\n",
       " '600475.SH',\n",
       " '600476.SH',\n",
       " '600510.SH',\n",
       " '600538.SH',\n",
       " '600587.SH',\n",
       " '600593.SH',\n",
       " '600597.SH',\n",
       " '600598.SH',\n",
       " '600605.SH',\n",
       " '600606.SH',\n",
       " '600626.SH',\n",
       " '600642.SH',\n",
       " '600667.SH',\n",
       " '600704.SH',\n",
       " '600727.SH',\n",
       " '600731.SH',\n",
       " '600768.SH',\n",
       " '600835.SH',\n",
       " '600857.SH',\n",
       " '600862.SH',\n",
       " '600993.SH',\n",
       " '601006.SH',\n",
       " '601069.SH',\n",
       " '601088.SH',\n",
       " '601098.SH',\n",
       " '601158.SH',\n",
       " '601163.SH',\n",
       " '601200.SH',\n",
       " '601225.SH',\n",
       " '601369.SH',\n",
       " '601628.SH',\n",
       " '601677.SH',\n",
       " '601717.SH',\n",
       " '601858.SH',\n",
       " '601928.SH',\n",
       " '601933.SH',\n",
       " '601958.SH',\n",
       " '603033.SH',\n",
       " '603040.SH',\n",
       " '603041.SH',\n",
       " '603106.SH',\n",
       " '603111.SH',\n",
       " '603169.SH',\n",
       " '603177.SH',\n",
       " '603181.SH',\n",
       " '603326.SH',\n",
       " '603331.SH',\n",
       " '603335.SH',\n",
       " '603398.SH',\n",
       " '603506.SH',\n",
       " '603538.SH',\n",
       " '603601.SH',\n",
       " '603668.SH',\n",
       " '603689.SH',\n",
       " '603696.SH',\n",
       " '603776.SH',\n",
       " '603777.SH',\n",
       " '603789.SH',\n",
       " '603855.SH',\n",
       " '603878.SH',\n",
       " '603885.SH',\n",
       " '603887.SH',\n",
       " '603901.SH',\n",
       " '603960.SH',\n",
       " '603977.SH',\n",
       " '603987.SH']"
      ]
     },
     "execution_count": 13,
     "metadata": {},
     "output_type": "execute_result"
    }
   ],
   "source": [
    "stock"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.3"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
